package com.rainszj.controller.site;

import com.rainszj.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 归档
 *
 * @author rainszj
 * 2020/3/22
 */
@Controller
public class ArchiveController {

    @Autowired
    private BlogService blogService;

    @GetMapping("/archives.html")
    public String toArchivePage(Model model) {

        model.addAttribute("archiveMap", blogService.archive());
        model.addAttribute("blogCount", blogService.countBlog());
        return "site/archives";
    }

}
